package serive;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Iterator;
import java.util.Map;

import org.json.JSONArray;

import dao.ResultMap;
import dao.hive.Connect;
import dao.hive.HiveUtil;


public class logservie {

	//得到Map数据集
	
	public static Map<String, Integer> getKeyCountSort(String tablename ,String sql_ref ,Connection conn) {
		Map<String, Integer> resultMap = null;
		try {
			resultMap = ResultMap.getMapSet(tablename, sql_ref,conn);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return resultMap;

	}
	public static long keyword() throws SQLException
	{
		String sql ="select keyword ,count(keyword)as count from sogoulog group by keyword order by count desc limit 10";
		String tomysql="insert into logcount values(?,?)";
		
		long times =HiveUtil.execute(sql, tomysql);
		return times;
		
	}
}
